/**
 * File    : AttributeManagerImpl.java
 * Created : 2008-10-10
 * By      : LuHuiguo
 */
package com.luhuiguo.sso.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Required;
import org.springframework.transaction.annotation.Transactional;

import com.luhuiguo.sso.dao.AttributeDao;
import com.luhuiguo.sso.entity.Attribute;
import com.luhuiguo.sso.service.AttributeManager;

/**
 * @author LuHuiguo
 * @version $Id: AttributeManagerImpl.java 9 2008-10-12 12:51:20Z LuHuiguo $
 * 
 */
public class AttributeManagerImpl implements AttributeManager {

	private AttributeDao attributeDao;

	@Required
	public void setAttributeDao(AttributeDao attributeDao) {
		this.attributeDao = attributeDao;
	}

	@Transactional(readOnly = true)
	@Override
	public Attribute getAttribute(Long id) {
		return attributeDao.get(id);
	}

	@Transactional(readOnly = true)
	@Override
	public List<Attribute> getAllAttribute(int... rowStartIdxAndCount) {
		return attributeDao.findAll(rowStartIdxAndCount);
	}

	@Override
	public void createAttribute(Attribute attribute) {
		attributeDao.create(attribute);
	}

	@Override
	public void updateAttribute(Attribute attribute) {
		attributeDao.update(attribute);
	}

	@Override
	public void deleteAttribute(Long id) {
		attributeDao.delete(id);
	}

	@Override
	public void deleteAttribute(Attribute attribute) {
		attributeDao.delete(attribute);
	}

}
